<template>
  <div class="root">
    <div class="step-content">
      <div class="step-card">
        <div class="step-item">
          <span class="step-number">1</span
          ><span class="step-title">基础信息</span>
        </div>
        <div class="step-line"></div>
        <div class="step-item">
          <span class="step-number">2</span
          ><span class="step-title">匹配规则</span>
        </div>
        <div class="step-line"></div>
        <div class="step-item">
          <span class="step-number step-active">3</span
          ><span class="step-title">产品分配</span>
        </div>
        <div class="step-line"></div>
        <div class="step-item">
          <span class="step-number">4</span
          ><span class="step-title">活动设置</span>
        </div>
        <div class="step-line"></div>
        <div class="step-item">
          <span class="step-number">5</span
          ><span class="step-title">发布确认</span>
        </div>
      </div>
    </div>
    <el-form label-position="top" :model="params">
      <div class="card">
        <div class="title-card">
          <div class="title">SKU授权规则</div>
        </div>
        <div class="form">
          <el-row :gutter="60">
            <el-col :span="8">
              <el-form-item label="请选择授权模版">
                <el-select
                  v-model="params.SKUtemplateId"
                  placeholder="请选择授权模版"
                  clearable
                  style="width: 100%"
                >
                  <el-option
                    v-for="dict in templateList"
                    :key="dict.value"
                    :label="dict.name"
                    :value="dict.value"
                  />
                </el-select>
              </el-form-item>
            </el-col>
            <el-col :span="8">
              <el-form-item label="供应商类型">
                <el-checkbox-group v-model="params.SKUcheckList">
                  <el-checkbox
                    v-for="item in checkList"
                    :key="item.label"
                    :label="item.label"
                  />
                </el-checkbox-group>
              </el-form-item>
            </el-col>
            <el-col :span="8">
              <el-form-item label="合作时间">
                <el-row :gutter="20">
                  <el-col :span="8">
                    <el-select
                      v-model="params.SKUrange"
                      placeholder="请选择范围"
                      clearable
                    >
                      <el-option
                        v-for="dict in rangeList"
                        :key="dict.value"
                        :label="dict.name"
                        :value="dict.value"
                      />
                    </el-select>
                  </el-col>
                  <el-col :span="16">
                    <el-input
                      v-model="params.SKUyears"
                      placeholder="请输入合作年限"
                    >
                      <template #suffix>
                        <i class="suffix-text">年</i>
                      </template>
                    </el-input>
                  </el-col>
                </el-row>
              </el-form-item>
            </el-col>
          </el-row>
        </div>
      </div>
      <div class="card">
        <div class="title-card">
          <div class="title">经销商评分规则</div>
        </div>
        <div class="form">
          <el-row :gutter="60">
            <el-col :span="8">
              <el-form-item label="请选择授权模版">
                <el-select
                  v-model="params.JXStemplateId"
                  placeholder="请选择授权模版"
                  clearable
                  style="width: 100%"
                >
                  <el-option
                    v-for="dict in templateList"
                    :key="dict.value"
                    :label="dict.name"
                    :value="dict.value"
                  />
                </el-select>
              </el-form-item>
            </el-col>
            <el-col :span="8">
              <el-form-item label="供应商类型">
                <el-checkbox-group v-model="params.JXScheckList">
                  <el-checkbox v-for="item in checkList" :label="item.label" />
                </el-checkbox-group>
              </el-form-item>
            </el-col>
            <el-col :span="8">
              <el-form-item label="合作时间">
                <el-row :gutter="20">
                  <el-col :span="8">
                    <el-select
                      v-model="params.JXSrange"
                      placeholder="请选择范围"
                      clearable
                    >
                      <el-option
                        v-for="dict in rangeList"
                        :key="dict.value"
                        :label="dict.name"
                        :value="dict.value"
                      />
                    </el-select>
                  </el-col>
                  <el-col :span="16">
                    <el-input
                      v-model="params.JXSyears"
                      placeholder="请输入合作年限"
                    >
                      <template #suffix>
                        <i class="suffix-text">年</i>
                      </template>
                    </el-input>
                  </el-col>
                </el-row>
              </el-form-item>
            </el-col>
            <el-col :span="8">
              <el-form-item label="完成情况">
                <el-row :gutter="20">
                  <el-col :span="8">
                    <el-select
                      v-model="params.JXScomplateRange"
                      placeholder="请选择范围"
                      clearable
                    >
                      <el-option
                        v-for="dict in rangeList"
                        :key="dict.value"
                        :label="dict.name"
                        :value="dict.value"
                      />
                    </el-select>
                  </el-col>
                  <el-col :span="16">
                    <el-input
                      v-model="params.JXScomplatePercent"
                      placeholder="请输入完成比例"
                    >
                      <template #suffix>
                        <i class="suffix-text">%</i>
                      </template>
                    </el-input>
                  </el-col>
                </el-row>
              </el-form-item>
            </el-col>
            <el-col :span="8">
              <el-form-item label="销售评分">
                <el-row :gutter="20">
                  <el-col :span="8">
                    <el-select
                      v-model="params.JXSsaleRange"
                      placeholder="请选择范围"
                      clearable
                    >
                      <el-option
                        v-for="dict in rangeList"
                        :key="dict.value"
                        :label="dict.name"
                        :value="dict.value"
                      />
                    </el-select>
                  </el-col>
                  <el-col :span="16">
                    <el-input
                      v-model="params.JXSsaleScore"
                      placeholder="请输入销售评分"
                    >
                      <template #suffix>
                        <i class="suffix-text">分</i>
                      </template>
                    </el-input>
                  </el-col>
                </el-row>
              </el-form-item>
            </el-col>
          </el-row>
        </div>
      </div>
      <div class="card">
        <div class="title-card">
          <div class="title">场次间隔时长</div>
        </div>
        <div class="form">
          <el-row :gutter="60">
            <el-col :span="8">
              <el-form-item label="场次间隔时长">
                <el-input
                  v-model="params.sessionInterval"
                  placeholder="请输入场次间隔时长"
                >
                  <template #suffix>
                    <i class="suffix-text">分钟</i>
                  </template>
                </el-input>
              </el-form-item>
            </el-col>
          </el-row>
        </div>
      </div>
      <div class="card">
        <div class="title-card">
          <div class="title">报盘响应时长</div>
        </div>
        <div class="form">
          <el-row :gutter="60">
            <el-col :span="8">
              <el-form-item label="报盘响应时长">
                <el-input
                  v-model="params.requestInterval"
                  placeholder="请输入报盘响应时长"
                >
                  <template #suffix>
                    <i class="suffix-text">分钟</i>
                  </template>
                </el-input>
              </el-form-item>
            </el-col>
          </el-row>
        </div>
      </div>
    </el-form>
    <div class="footer" :class="classObj">
      <el-button type="primary" class="btn-back" @click="handleBack">
        返回
      </el-button>
      <div>
        <el-button @click="handleNextStep">下一步</el-button>
        <el-button>保存</el-button>
      </div>
    </div>
  </div>
</template>
<script setup>
import { ref } from "vue";
import useAppStore from "@/store/modules/app";
const sidebar = computed(() => useAppStore().sidebar);
const classObj = computed(() => ({
  hideSidebar: !sidebar.value.opened,
}));
const router = useRouter();
const params = ref({
  SKUtemplateId: 0,
  SKUcheckList: ["Gig4", "MM"],
  SKUrange: "≤",
  SKUyears: "",
  JXStemplateId: 0,
  JXScheckList: ["Gig4", "MM"],
  JXSrange: "≤",
  JXSyears: "",
  JXScomplateRange: "≥",
  JXScomplatePercent: "",
  JXSsaleRange: "≥",
  JXSsaleScore: "",
  sessionInterval: "",
  requestInterval: "",
});
const templateList = ref([
  {
    name: "2023111001授权机制",
    value: 0,
  },
  {
    name: "2023111002授权机制",
    value: 1,
  },
  {
    name: "2023111003授权机制",
    value: 2,
  },
  {
    name: "2023111004授权机制",
    value: 3,
  },
]);
const checkList = ref([
  {
    label: "Gig4",
  },
  {
    label: "MM",
  },
  {
    label: "经销商",
  },
]);
const rangeList = ref([
  {
    name: "≤",
    value: 0,
  },
  {
    name: "≥",
    value: 1,
  },
]);
const total = ref(12);
const pageNum = ref(1);
const pageSize = ref(10);
function handleNextStep() {
  router.push("/headquarters/auctioncenter/productdistribution");
}
function handleBack() {
  router.back();
}
</script>
<style lang="scss" scoped>
.root {
  padding-bottom: 64px;
  .step-content {
    display: flex;
    justify-content: end;
    align-items: center;
    padding: 20px 24px 0 24px;
    .step-card {
      display: flex;
      justify-content: space-around;
      align-items: center;
      .step-item {
        .step-number {
          padding: 4px 8px;
          background-color: #ecedec;
          color: #000000;
          margin-right: 4px;
        }
        .step-active {
          background-color: #000000;
          color: #ffffff;
        }
        .step-title {
        }
      }
      .step-line {
        display: block;
        width: 30px;
        height: 1px;
        border: 1px solid #000000;
        margin: 0 8px;
      }
    }
  }
  .title-card {
    display: flex;
    justify-content: space-between;
    .title {
      font-size: 18px;
      font-weight: 500;
      color: #000000;
      line-height: 25px;
    }
  }
  .card {
    padding: 24px 24px 0 24px;
    border-bottom: 1px solid #dadbda;
    .form {
      padding: 16px;
      ::v-deep(.el-input__wrapper) {
        background-color: #f4f4f4;
      }
      ::v-deep(.el-textarea__inner) {
        background-color: #f4f4f4;
      }
      .suffix-text {
        color: #000000;
      }
    }
  }
  .footer {
    position: fixed;
    bottom: 0;
    left: 200px;
    right: 0;
    height: 64px;
    background-color: #000000;
    z-index: 9;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 24px;
    button {
      padding: 0 26px;
      border-radius: 0;
    }
    .btn-back {
      border: 1px solid #ffffff;
    }
  }
  .hideSidebar {
    left: 54px !important;
  }
}
</style>
